<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:a4j="http://richfaces.org/a4j">

<h:head>
	<title>RichFaces Demo</title>
</h:head>

<h:body>

	<h:form id="formPrueba">

		<!--  PANEL -->
		<!-- 
		<rich:panel header="This is the panel header">
			<h:outputText value="This is the panel content" />
		</rich:panel>
 		-->

		<!--  POPUPPANEL -->
		<rich:panel id="panelPrueba" header="Prueba de POPUPPANEL">

			<h:commandLink value="Show pop-up">
				<rich:componentControl target="popup" operation="show" />
			</h:commandLink>

			<rich:popupPanel id="popup" modal="false" autosized="true"
				resizeable="false"
				show="true"
				rendered="#{pruebaController.mostrarModal}">
				<f:facet name="header">
					<h:outputText value="The title of the panel" />
				</f:facet>
				<f:facet name="controls">
					<h:graphicImage value="./img/close.png" style="cursor:pointer"
						onclick="#{rich:component('popup')}.hide()" />
				</f:facet>
				<p>This is the content of the panel.</p>

				<a4j:commandButton id="botonCerrar" value="Cerrar con oclick"
					action="#{pruebaController.accionAction}"
					onclick="#{rich:component('popup')}.hide()">
				</a4j:commandButton>
				<a4j:commandButton value="Cerrar con Rich"
					action="#{pruebaController.accionAction}">
					<rich:componentControl target="popup" operation="hide" />
				</a4j:commandButton>
				<a4j:commandButton value="Cerrar con action"
					action="#{pruebaController.cerrarModalAction}"
					render="botonCerrar">
				</a4j:commandButton>


			</rich:popupPanel>
		</rich:panel>

		<!-- A4J:COMMANDBUTTON -->
		<a4j:commandButton value="Mostrar modal con onclick"
			action="#{pruebaController.accionAction}"
			onclick="#{rich:component('popup')}.show()">
		</a4j:commandButton>
		<a4j:commandButton value="Mostrar modal con Rich"
			action="#{pruebaController.accionAction}">
			<rich:componentControl target="popup" operation="show" />
		</a4j:commandButton>
		<a4j:commandButton value="Mostrar modal con action"
			action="#{pruebaController.abrirModalAction}"
			render="popup">
		</a4j:commandButton>






	</h:form>

</h:body>

</html>
